package io.sunny.platform.ai.deepseek.model;

import lombok.Data;

/**
 * @Author SUNNY
 * @Date 2025/11/29 21:08
 * @PackageName: io.sunny.platform.ai.deepseek.model
 * @Description: TODO
 * @Version 1.0
 */
@Data
public class CodeGenerationResult {
    private String content;
    private long costTime;
    private String errorMsg;

    private CodeGenerationResult() {
    }

    private CodeGenerationResult(String content, long costTime) {
        this.content = content;
        this.costTime = costTime;
    }

    public static CodeGenerationResult success(String content, long costTime) {
        return new CodeGenerationResult(content, costTime);
    }

    public static CodeGenerationResult fail(String errorMsg) {
        CodeGenerationResult result = new CodeGenerationResult();
        result.setErrorMsg(errorMsg);
        return result;
    }
}
